﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DRSM
{
    public partial class Welcome : Form
    {

        public Welcome()
        {
            InitializeComponent();
            //copyhere-----------------------
            this.lblTime.Text = DateTime.Now.ToString();
            this.timer1.Start();
            this.timer2.Start();
            //---------------------------------

        }

        private void pbxMenu_Click(object sender, EventArgs e)
        {

        }

        private void btnFinancialAid_Click(object sender, EventArgs e)
        {
           // AllFormClass.fa.Show();
            this.Hide();
        }

        private void btnAffectedCities_Click(object sender, EventArgs e)
        {
            AllFormClass.ac.Show();
            this.Hide();
        }

        private void btnPhysicalAid_Click(object sender, EventArgs e)
        {
            //AllFormClass.pa.Show();
            this.Hide();
        }

        private void btnSupportPersonnel_Click(object sender, EventArgs e)
        {
            AllFormClass.sp.Show();
            this.Hide();
        }

        private void btnAffectedCities_Click_1(object sender, EventArgs e)
        {
            AllFormClass.ac.Show();
            this.Hide();
        }

        private void btnSupportPersonnel_Click_1(object sender, EventArgs e)
        {
            AllFormClass.sp.Show();
            this.Hide();

        }

        private void btnPhysicalAid_Click_1(object sender, EventArgs e)
        {
            AllFormClass.pa.Show();
            this.Hide();
        }

        private void Welcome_Load(object sender, EventArgs e)
        {

        }

        private void btnFinancialAid_Click_1(object sender, EventArgs e)
        {

        }

        private void tbxWelcomeMenu_Click(object sender, EventArgs e)
        {

        }
        //copyhere===============================================================================================
        private void lblLogout_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            DialogResult dr = MessageBox.Show("Are you sure you want to logout?",
                              "Warning",
                              MessageBoxButtons.YesNo,
                              MessageBoxIcon.Exclamation);

            if (dr == DialogResult.Yes)
            {
                AllFormClass.lp.Show();
                this.Hide();
            }
            else if (dr == DialogResult.No)
            {

            }
        }
        //copyhere=================================================================================================

        //copyhere=================================================================================================
        private void timer1_Tick(object sender, EventArgs e)
        {
            this.lblTime.Text = DateTime.Now.ToString();
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            foreach (user u in AllFormClass.User)
            {
                if (u.Name == u.Name)
                {
                    this.lblWelcome.Text = "Welcome, " + u.Name;
                }
            }

        }

        private void lblTime_Click(object sender, EventArgs e)
        {

        }
        //copyhere=================================================================================================


    }
}
